﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HigLabo.WindowsAzure.RestService.Extensions;

namespace HigLabo.WindowsAzure.RestService.SqlAzureManagement
{
    public class GetServersResult : SqlAzureManagementServiceResult
    {
        public List<Server> Servers { get; private set; }

        protected override void LoadBody()
        {
            Servers = new List<Server>();
            var root = BodyXml.Root;
            var l = root.ElementsByLocalName(Server.ElementName);
            foreach (var item in l)
            {
                var el = item;
                var add = new Server(el);
                Servers.Add(add);
            }
        }
    }
}
